-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IECoreUSD::PointInstancerAlgo : Support inactive / invisible ids #1437
base: RB-10.5
Are you sure you want to change the base?
IECoreUSD::PointInstancerAlgo : Support inactive / invisible ids #1437
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Daniel - couple of small comments inline. We also need to target this to RB-10.5
.
} | ||
|
||
pxr::SdfInt64ListOp inactiveIdsListOp; | ||
pointInstancer.GetPrim().GetMetadata( pxr::UsdGeomTokens->inactiveIds, &inactiveIdsListOp ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -86,6 +86,19 @@ IECore::ObjectPtr readPointInstancer( pxr::UsdGeomPointInstancer &pointInstancer | |||
Canceller::check( canceller ); | |||
PrimitiveAlgo::readPrimitiveVariable( pointInstancer.GetAngularVelocitiesAttr(), time, newPoints.get(), "angularVelocity" ); | |||
|
|||
DataPtr cortexInvisIds = DataAlgo::fromUSD( pointInstancer.GetInvisibleIdsAttr(), time, true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to account for the loading of this in pointInstancerMightBeTimeVarying()
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
pxr::SdfInt64ListOp inactiveIdsListOp; | ||
pointInstancer.GetPrim().GetMetadata( pxr::UsdGeomTokens->inactiveIds, &inactiveIdsListOp ); | ||
newPoints->variables["inactiveIds"] = IECoreScene::PrimitiveVariable( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, should we avoid making this if the list is empty? Or was never authored? I think we're doing the "never authored" thing for invisibleIds
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now added a test that we get only the expected primitive variables, which required fixes for both inactiveIds and invisibleIds.
I'm confused by your comment "I think we're doing the "never authored" thing for invisibleIds?", since invisibleIds is just being added - do you mean that you expected fromUSD to return null for attributes that aren't authored? That isn't happening, I had to explicitly add a check for HasAuthoredValue for invisibleIds. It's kind of weird that this isn't needed for other attributes like angularVelocities - I guess the USD schema defines a fallback for invisibleIds but not for things like angularVelocities.
995de90
to
30ba213
Compare
Addressed comments, squashed, rebased to RB-10.5 |
This is a pretty naive implementation of loading inactiveIds and invisibleIds as prim vars, but everything seems to work.
Haven't yet used this to recreate the correct behaviour in Gaffer, but all the relevant data seems to be coming through.